package com.vaadin.incubator.bugrap.model.projects;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

import com.vaadin.incubator.bugrap.model.facade.AbstractEntity;
import com.vaadin.incubator.bugrap.model.users.Reporter;

@Entity
public class Project extends AbstractEntity {

	private String name;

	@ManyToOne(cascade = CascadeType.MERGE)
	private Reporter manager;

	@OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
	private List<Reporter> developers;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Reporter getManager() {
		return manager;
	}

	public void setManager(Reporter manager) {
		this.manager = manager;
	}

	@Override
	public String toString() {
		return name;
	}

	public List<Reporter> getDevelopers() {
		return developers;
	}

	public void setDevelopers(List<Reporter> developers) {
		this.developers = developers;
	}
}
